<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";
// import SockJS from "sockjs-client";
// import Stomp from "stompjs";

export default {
  name: "App",
  components: { ThemePicker },
    metaInfo() {
        return {
            title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
            titleTemplate: title => {
                return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
            }
        }
    }
    // mounted() {
    //   this.initWebSocket(); //页面渲染的时候，对ws进行初始化
    // },
    // methods: {
    //   initWebSocket() {
    //     var that = this;
    //     var socket = new SockJS(
    //       "http://localhost:8080/api/ws/path/asset/232323"); //链接SockJS 的endpoint 名称为"/endpointOne"
    //     var stomp = Stomp.over(socket); //使用stomp子协议的WebSocket 客户端
    //     stomp.connect({}, function(frame) { //链接Web Socket的服务端。
    //       stomp.subscribe("/topic/notifications", function(respnose) {
    //         //订阅指定用户消息
    //         MessageBox.confirm("有订单过来了", "订单处理", {
    //           confirmButtonText: "立即处理",
    //           cancelButtonText: "暂不处理",
    //           type: "warning",
    //         }).then(() => {
    //           that.$router.push({
    //             path: "/order"
    //           });
    //         });
    //       });
    //     });
    //   },
    // }

};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
